package com.wuliupai.delivery.wuliupaidelivery.activity;

import com.wuliupai.delivery.wuliupaidelivery.R;
import com.wuliupai.delivery.wuliupaidelivery.constants.Value;
import com.wuliupai.delivery.wuliupaidelivery.utils.SharePreferenceUtil;

import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Bean;
import org.androidannotations.annotations.Click;
import org.androidannotations.annotations.EActivity;

@EActivity(R.layout.activity_wallet)
public class WalletActivity extends AppBaseActivity {
    //int totalMoney;
    /*@ViewById(R.id.tv_wallet_balance)
    TextView tv_wallet_balance;*/
    @Bean(SharePreferenceUtil.class)
    SharePreferenceUtil mSharePreferenceUtil;

    @Click(R.id.rl_wallet_balance)
    void clickBalance() { //点击余额界面
        WalletBalanceActivity_.intent(this).start();
    }

    @Click(R.id.rl_wallet_card)
    void clickCard() { //点击银行卡
        WalleBankCard_.intent(this).start();
    }

    @Click(R.id.rl_wallet_pay)
    void clickPay() { //点击支付密码
        int password = mSharePreferenceUtil.getWhetherPayPassword();
        if (password == 0) {
            SetPasswordActivity_.intent(this).ifModification(Value.SetPasswordType_Setting).ifSetupTradingPassword(true).start();
        } else if (password == 1) {
            SetPasswordActivity_.intent(this).ifModification(Value.SetPasswordType_Modification).ifSetupTradingPassword(true).start();
        }
    }

    @Click(R.id.rl_wallet_trading)
    void clickTrading() {//点击 交易记录
        WalletTradingRecordActivity_.intent(this).start();
    }

    @AfterViews
    void onPageStart() {
        setDefaultTitle(this, "派哥钱包");

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }
}
